package kr.hkit.powerjava.coffee;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;
import java.util.Scanner;

import kr.hkit.powerjava.coffee.dao.CoffeeDAO;
import kr.hkit.powerjava.coffee.db.ConnectionFactory;
import kr.hkit.powerjava.coffee.db.DBProperies;
import kr.hkit.powerjava.coffee.db.DbUtil;
import kr.hkit.powerjava.coffee.dto.SalesRecord;
import kr.hkit.powerjava.coffee.service.AbsService;
import kr.hkit.powerjava.coffee.service.CoffeeService;

public class Main {
	public static void main(String[] args) {

		/*
		 * String driver = "com.mysql.jdbc.Driver"; String url =
		 * "jdbc:mysql://localhost:3306/sales_record"; String user = "root";
		 * String password = "jang1305";
		 * 
		 * DBProperies.savePropertis("dbcon.xml", driver, url, user, password);
		 * Properties prop = DBProperies.loadPropertis("dbcon.xml");
		 * System.out.println(prop.getProperty("DRIVER"));
		 * System.out.println(prop.getProperty("URL"));
		 * System.out.println(prop.getProperty("USER"));
		 * System.out.println(prop.getProperty("PASSWORD"));
		 * 
		 * DBProperies.prnProperties(prop); // 설정 확인
		 */
		
		Connection connnection = ConnectionFactory.getConnection();// 접속 확인
		System.out.println(connnection);

		Scanner sc = new Scanner(System.in);
		AbsService<SalesRecord> deptSvc = new CoffeeService(sc, connnection);
		deptSvc.prnMenu(2, 1);

		sc.close();

	}
}
